package cn.iocoder.yudao.module.member.dal.mysql.userinformation;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.app.userinformation.vo.AppUserInformationPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.userinformation.UserInformationDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户身份资料列 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserInformationMapper extends BaseMapperX<UserInformationDO> {

    default PageResult<UserInformationDO> selectPage(AppUserInformationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserInformationDO>()
                .eqIfPresent(UserInformationDO::getProposer, reqVO.getProposer())
                .eqIfPresent(UserInformationDO::getProposerMobile, reqVO.getProposerMobile())
                .likeIfPresent(UserInformationDO::getCaseName, reqVO.getCaseName())
                .likeIfPresent(UserInformationDO::getCaseName, reqVO.getSearchValue())
                .eqIfPresent(UserInformationDO::getIdCardPortraitFace, reqVO.getIdCardPortraitFace())
//                .eqIfPresent(UserInformationDO::getIdCardNationalEmblem, reqVO.getIdCardNationalEmblem())
                .eqIfPresent(UserInformationDO::getOtherFiles, reqVO.getOtherFiles())
                .eqIfPresent(UserInformationDO::getUserId, reqVO.getUserId())
                .orderByDesc(UserInformationDO::getId));
    }

}